import request from '@/utils/request'

// 查询 账户列表
export function getAccountList(query) {
    return request({
        url: '/trade/account/querySelfAccountByPage.action',
        method: 'get',
        params: query
    })
}

export function deleteAccount(query) {
    return request({
        url: '/trade/account/deleteAccount.action',
        method: 'post',
        params: query
    })
}

export function updateAccount(query) {
    return request({
        url: '/trade/account/updateAccount.action',
        method: 'post',
        params: query
    })
}

export function saveAccount(query) {
    return request({
        url: '/trade/account/addAccount.action',
        method: 'post',
        params: query
    })
}



export function updateUserAuthor(params) {
    return request({
        url: '/trade/account/updateAccountUser.action',
        method: 'post',
        data: params
    })
}


/**查询有当前账户id的部门和用户 */
export function getAccountUserAndDpetPerm(query){
    return request({
        url: '/trade/account/queryAccountUserAndDeptPerm.action',
        method: 'get',
        params: query
    })
}


/** 修改账户id的权限 */
export function updateAccountPerm(data){
    return request({
        url: '/trade/account/updateAccountPerm.action',
        method: 'post',
        params: data
    })
}



//查询当前登录用户的有权限的部门下的所属用户
export function listAllocateUser(query){
    return request({
      url: '/system/user/listAccountAllocateUser',
      method: 'get',
      params: query
    })
  }



  // 查询用当前用户进行的交易数量
export function queryTtradeCountByAccId(query) {
    return request({
        url: '/pricing/trade/queryTtradeCountByAccId.action',
        method: 'get',
        params: query
    })
}